import service from '../utils/request'

// 获取图书列表
export const getBookList = (params) => {
    return service({
        url: '/book/list',
        method: 'get',
        params
    })
}

// 添加图书
export const addBook = (data) => {
    return service({
        url: '/book/add',
        method: 'post',
        data
    })
}

// 更新图书
export const updateBook = (data) => {
    return service({
        url: '/book/update',
        method: 'put',
        data
    })
}

// 删除图书
export const deleteBook = (bookId) => {
    return service({
        url: `/book/delete/${bookId}`,
        method: 'delete'
    })
}
